package weibo.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
public class UserRegDTO {
    // 注册的时候对数据进行验证
    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{1,30}$",message = "用户名格式不正确,要求1~30位")
    @ApiModelProperty(value = "用户名",required = true)
    private String username;
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_]{6,30}$",message = "密码格式不正确,要求6~30位")
    @ApiModelProperty(value = "密码",required = true)
    private String password;
    @NotBlank(message = "昵称不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{1,30}$",message = "昵称格式不正确,要求1~30位")
    @ApiModelProperty(value = "昵称",required = true)
    private String nickname;
}
